package com.cybertron.ironhide.manage.common.json;

import java.text.SimpleDateFormat;

import org.codehaus.jackson.map.ObjectMapper;
import org.codehaus.jackson.map.SerializationConfig;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import com.cybertron.ironhide.manage.common.Constants;

public class JacksonObjectMapper extends ObjectMapper {

	@SuppressWarnings("deprecation")
	public JacksonObjectMapper() {
		super();
		configure(SerializationConfig.Feature.INDENT_OUTPUT, true);
		configure(SerializationConfig.Feature.WRAP_ROOT_VALUE, false);
		getSerializationConfig().setSerializationInclusion(
				JsonSerialize.Inclusion.NON_NULL);
		configure(SerializationConfig.Feature.WRITE_NULL_MAP_VALUES, false);
		setDateFormat(new SimpleDateFormat(Constants.RFC3339_FORMAT));
	}
}
